from django.conf.urls import url

from meiduo_admin.serializer import statistical_serializer
from meiduo_admin.views import users, specs, image, statistical
from rest_framework_jwt.views import obtain_jwt_token
from rest_framework.routers import DefaultRouter

urlpatterns = [
    url(r'^authorizations/$', obtain_jwt_token),

    # --------------  数据统计 -----------------
    # 用户总量
    url(r'^statistical/total_count/$', statistical.UserCountView.as_view()),
    # 日增用户
    url(r'^statistical/day_increment/$', statistical.UserDayCountView.as_view()),
    # 日活用户
    url(r'^statistical/day_active/$', statistical.UserDayActiveCountView.as_view()),
    # 下单用户
    url(r'^statistical/day_orders/$', statistical.UserDayOrdersCountView.as_view()),
    # 月增用户
    url(r'^statistical/month_increment/$', statistical.UserMonthCountView.as_view()),

    url(r'^statistical/goods_day_views/$', statistical.UserGoodsCountView.as_view()),

    # ---------用户管理器－－－－－－－
    url(r'^users/$', users.UserViews.as_view()),
    # ---------商品规格－－－－－－－
    url(r'^goods/simple/$', specs.SpecsView.as_view({"get": "simple"})),
    # ------------图片路由————————————
    url(r'^skus/simple/$', image.ImageView.as_view({'get': 'simple'})),

]
# ---------商品规格－－－－－－－－
router = DefaultRouter()
router.register('goods/specs', specs.SpecsView, base_name='specs')
urlpatterns += router.urls
# ---------商品图片管理－－－－－－－－
router = DefaultRouter()
router.register('skus/images', image.ImageView, base_name='images')
urlpatterns += router.urls
